﻿<UserControl x:Class="SilverlightTimer.SilverlightTimerControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:vm="clr-namespace:SilverlightCountDownTimer.ViewModel"
    Width="200" Height="100">
    
    <!--Styles-->
    <UserControl.Resources>
        <Style TargetType="TextBlock" x:Key="TextBlockTimeDesc" >
            <Setter Property="FontSize" Value="23" />
            <Setter Property="Foreground" Value="White" />
        </Style>
        <Style TargetType="TextBlock" x:Key="TextBlockTimeLables" >
            <Setter Property="FontSize" Value="12" />
            <Setter Property="Margin" Value="1, 0, 4, 0" />
            <Setter Property="Foreground" Value="#FFCECECE" />
        </Style>
        <Style TargetType="TextBlock" x:Key="EventDescription" >
            <Setter Property="FontSize" Value="14" />
            <Setter Property="Margin" Value="2" />
            
        </Style>
    </UserControl.Resources>
    
    <!--Setting ViewModel-->
    <UserControl.DataContext>
        <vm:SilverlightTimerControlViewModel />
    </UserControl.DataContext>
    
    <Grid x:Name="LayoutRoot" >        
    	<Border CornerRadius="20,20,20,20" BorderBrush="#FF000000" BorderThickness="1,1,1,1">
    		<Border.Background>
    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    				<GradientStop Color="#FF000000" Offset="0.62"/>
    				<GradientStop Color="#FFFFFFFF" Offset="0.799"/>
    				<GradientStop Color="#FFFDFDFD" Offset="0.025"/>
    				<GradientStop Color="#FE000000" Offset="0.06"/>
    				<GradientStop Color="#FF9D9D9D" Offset="0.993"/>
    			</LinearGradientBrush>
    		</Border.Background>
    		<Grid Margin="5,5,5,5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="60" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>

    			<!--// Event's time Description-->
    			<Border Grid.Row="0" Background="#FF6633BF" BorderThickness="2,2,2,2" CornerRadius="10,10,10,10" BorderBrush="#FFADADAD">
    				<Grid>
        
    					<!--// Time-->
    					<StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,10" VerticalAlignment="Center" HorizontalAlignment="Center" >
    						<!--<TextBlock Text="{Binding Path=Days}" Style="{StaticResource TextBlockTimeDesc}" />
    						<TextBlock Text=":" Style="{StaticResource TextBlockTimeDesc}"/>-->
                            <TextBlock Text="{Binding Path=Time}" Style="{StaticResource TextBlockTimeDesc}"/>
    						<!--<TextBlock Text="{Binding Path=Hours}" Style="{StaticResource TextBlockTimeDesc}"/>
    						<TextBlock Text=":" Style="{StaticResource TextBlockTimeDesc}"/>
    						<TextBlock Text="{Binding Path=Minutes}" Style="{StaticResource TextBlockTimeDesc}"/>
    						<TextBlock Text=":" Style="{StaticResource TextBlockTimeDesc}"/>
    						<TextBlock Text="{Binding Path=Seconds}" Style="{StaticResource TextBlockTimeDesc}"/>
    						<TextBlock Text=":" Style="{StaticResource TextBlockTimeDesc}"/>
    						<TextBlock Text="{Binding Path=MiliSeconds}" Style="{StaticResource TextBlockTimeDesc}"/>-->
    					</StackPanel>
        
    					<!--// Time Description-->
    					<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Center">
    						<TextBlock Text="Days" Style="{StaticResource TextBlockTimeLables}" />
    						<TextBlock Text="Minutes" Style="{StaticResource TextBlockTimeLables}" />
    						<TextBlock Text="Hours"  Style="{StaticResource TextBlockTimeLables}"/>
    						<TextBlock Text="Seconds" Style="{StaticResource TextBlockTimeLables}" />
    						<!--<TextBlock Text="MiliSec." Style="{StaticResource TextBlockTimeLables}" />-->
    					</StackPanel>

    				</Grid>
    			</Border>

                <!--// Event's Description-->
    			<StackPanel Orientation="Horizontal" Height="22" Width="187" Grid.Row="1">
                    <StackPanel.Clip>
                        <RectangleGeometry Rect="0,0, 187, 22" />
                    </StackPanel.Clip>
    				<TextBlock x:Name="textBlock" Text="{Binding Path=Description}" Style="{StaticResource EventDescription}" HorizontalAlignment="Stretch" 
                               FontSize="14" FontFamily="Verdana" Width="186" RenderTransformOrigin="0.5,0.5" >    					
    				</TextBlock>
    			</StackPanel>
    		</Grid>
    	</Border>
    </Grid>
</UserControl>
